import { createApp } from "vue";
import { createPinia } from "pinia";

// pinia数据持久化
import piniaPluginPersist from "pinia-plugin-persist";

import App from "./App.vue";
import router from "./router";

import Antd from "ant-design-vue";
import "ant-design-vue/dist/antd.css";
// 动态使用icon
import * as antIcons from "@ant-design/icons-vue";

// 引入animate css库
import "animate.css";

const app = createApp(App);

// 全局组件
import card from "@/components/public/public_card.vue";
app.component("card", card);

Object.keys(antIcons).forEach((key) => {
  app.component(key, antIcons[key as keyof typeof antIcons]);
});

app.use(Antd);
app.use(createPinia().use(piniaPluginPersist));
app.use(router);

app.mount("#app");
